package com.iris.live.services.data.models;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;

/**
 * Created by lusong on 2017/3/29.
 */
@Entity
@Table(name = "crm_history", schema = "iris_ls", catalog = "")
public class CrmHistoryModel implements Serializable {
    private Integer id;
    private String permit;
    private String stage;
    private String crm;
    private Integer custId;
    private String researchState;
    private String valid;
    private String nowState;
    private String remark;
    private String otherRemark;
    private Date connectDate;
    private Timestamp connectTime;
    private Timestamp nextConnectDate;
    private String groupVersion;
    private String dealerVersion;
    private String historyState;
    private Integer serialNumber;
    private String surveyResult;
    private String updateAccount;
    private Timestamp updateTime;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "permit")
    public String getPermit() {
        return permit;
    }

    public void setPermit(String permit) {
        this.permit = permit;
    }

    @Basic
    @Column(name = "stage")
    public String getStage() {
        return stage;
    }

    public void setStage(String stage) {
        this.stage = stage;
    }

    @Basic
    @Column(name = "crm")
    public String getCrm() {
        return crm;
    }

    public void setCrm(String crm) {
        this.crm = crm;
    }

    @Basic
    @Column(name = "custId")
    public Integer getCustId() {
        return custId;
    }

    public void setCustId(Integer custId) {
        this.custId = custId;
    }

    @Basic
    @Column(name = "researchState")
    public String getResearchState() {
        return researchState;
    }

    public void setResearchState(String researchState) {
        this.researchState = researchState;
    }

    @Basic
    @Column(name = "valid")
    public String getValid() {
        return valid;
    }

    public void setValid(String valid) {
        this.valid = valid;
    }

    @Basic
    @Column(name = "nowState")
    public String getNowState() {
        return nowState;
    }

    public void setNowState(String nowState) {
        this.nowState = nowState;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "otherRemark")
    public String getOtherRemark() {
        return otherRemark;
    }

    public void setOtherRemark(String otherRemark) {
        this.otherRemark = otherRemark;
    }

    @Basic
    @Column(name = "connectDate")
    public Date getConnectDate() {
        return connectDate;
    }

    public void setConnectDate(Date connectDate) {
        this.connectDate = connectDate;
    }

    @Basic
    @Column(name = "connectTime")
    public Timestamp getConnectTime() {
        return connectTime;
    }

    public void setConnectTime(Timestamp connectTime) {
        this.connectTime = connectTime;
    }

    @Basic
    @Column(name = "nextConnectDate")
    public Timestamp getNextConnectDate() {
        return nextConnectDate;
    }

    public void setNextConnectDate(Timestamp nextConnectDate) {
        this.nextConnectDate = nextConnectDate;
    }

    @Basic
    @Column(name = "groupVersion")
    public String getGroupVersion() {
        return groupVersion;
    }

    public void setGroupVersion(String groupVersion) {
        this.groupVersion = groupVersion;
    }

    @Basic
    @Column(name = "dealerVersion")
    public String getDealerVersion() {
        return dealerVersion;
    }

    public void setDealerVersion(String dealerVersion) {
        this.dealerVersion = dealerVersion;
    }

    @Basic
    @Column(name = "historyState")
    public String getHistoryState() {
        return historyState;
    }

    public void setHistoryState(String historyState) {
        this.historyState = historyState;
    }

    @Basic
    @Column(name = "serialNumber")
    public Integer getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(Integer serialNumber) {
        this.serialNumber = serialNumber;
    }

    @Basic
    @Column(name = "surveyResult")
    public String getSurveyResult() {
        return surveyResult;
    }

    public void setSurveyResult(String surveyResult) {
        this.surveyResult = surveyResult;
    }

    @Basic
    @Column(name = "updateAccount")
    public String getUpdateAccount() {
        return updateAccount;
    }

    public void setUpdateAccount(String updateAccount) {
        this.updateAccount = updateAccount;
    }

    @Basic
    @Column(name = "updateTime")
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CrmHistoryModel that = (CrmHistoryModel) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (permit != null ? !permit.equals(that.permit) : that.permit != null) return false;
        if (stage != null ? !stage.equals(that.stage) : that.stage != null) return false;
        if (crm != null ? !crm.equals(that.crm) : that.crm != null) return false;
        if (custId != null ? !custId.equals(that.custId) : that.custId != null) return false;
        if (researchState != null ? !researchState.equals(that.researchState) : that.researchState != null)
            return false;
        if (valid != null ? !valid.equals(that.valid) : that.valid != null) return false;
        if (nowState != null ? !nowState.equals(that.nowState) : that.nowState != null) return false;
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
        if (otherRemark != null ? !otherRemark.equals(that.otherRemark) : that.otherRemark != null) return false;
        if (connectDate != null ? !connectDate.equals(that.connectDate) : that.connectDate != null) return false;
        if (connectTime != null ? !connectTime.equals(that.connectTime) : that.connectTime != null) return false;
        if (nextConnectDate != null ? !nextConnectDate.equals(that.nextConnectDate) : that.nextConnectDate != null)
            return false;
        if (groupVersion != null ? !groupVersion.equals(that.groupVersion) : that.groupVersion != null) return false;
        if (dealerVersion != null ? !dealerVersion.equals(that.dealerVersion) : that.dealerVersion != null)
            return false;
        if (historyState != null ? !historyState.equals(that.historyState) : that.historyState != null) return false;
        if (serialNumber != null ? !serialNumber.equals(that.serialNumber) : that.serialNumber != null) return false;
        if (surveyResult != null ? !surveyResult.equals(that.surveyResult) : that.surveyResult != null) return false;
        if (updateAccount != null ? !updateAccount.equals(that.updateAccount) : that.updateAccount != null)
            return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (permit != null ? permit.hashCode() : 0);
        result = 31 * result + (stage != null ? stage.hashCode() : 0);
        result = 31 * result + (crm != null ? crm.hashCode() : 0);
        result = 31 * result + (custId != null ? custId.hashCode() : 0);
        result = 31 * result + (researchState != null ? researchState.hashCode() : 0);
        result = 31 * result + (valid != null ? valid.hashCode() : 0);
        result = 31 * result + (nowState != null ? nowState.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (otherRemark != null ? otherRemark.hashCode() : 0);
        result = 31 * result + (connectDate != null ? connectDate.hashCode() : 0);
        result = 31 * result + (connectTime != null ? connectTime.hashCode() : 0);
        result = 31 * result + (nextConnectDate != null ? nextConnectDate.hashCode() : 0);
        result = 31 * result + (groupVersion != null ? groupVersion.hashCode() : 0);
        result = 31 * result + (dealerVersion != null ? dealerVersion.hashCode() : 0);
        result = 31 * result + (historyState != null ? historyState.hashCode() : 0);
        result = 31 * result + (serialNumber != null ? serialNumber.hashCode() : 0);
        result = 31 * result + (surveyResult != null ? surveyResult.hashCode() : 0);
        result = 31 * result + (updateAccount != null ? updateAccount.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        return result;
    }
}
